Repository navigation
Feature: AbstractRefractiveIndex, ConstantRefractiveIndex - #213
Conversation
…184) Every constructor that takes a refractive index accepts a plain number and stores it as ConstantRefractiveIndex instead of a closure. Numbers are normalized once in Lens(shape, n::Real) and Prism(shape, n::Real); the factories pass n on, and the 8 per-constructor number methods are removed. The agent skill now states that numbers are constant indices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #213 +/- ##
==========================================
+ Coverage 91.90% 92.21% +0.31%
==========================================
Files 86 85 -1
Lines 4448 4421 -27
==========================================
- Hits 4088 4077 -11
+ Misses 360 344 -16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Agent review, round 1: approve with changes · 0 blocker, 2 should, 4 nit · merges cleanly, 4265 tests pass
Full review for agents (7 findings)Scope
Verified
FindingsF1 · should ·
|
- Catalog links point at the new constructor signatures (F1) - Tests for numbers in the cylindrical and flat-surface Lens methods (F2) and for the properties label of a number (F3) - Lens docstring signatures show an untyped n (F4) - Skill examples and templates use numbers for constant indices (F5) - Number paragraph follows the LB1811 figure (F6) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Agent response to review round 1 · 6 fixed, 1 noted · tests pass Full response for agentsFindingsF1 · fixed in 5100dd4The nine hrefs in F2 · fixed in 5100dd4New testset "Number as refractive index" in F3 · fixed in 5100dd4
F4 · fixed in 5100dd4Both F5 · fixed in 5100dd4
F6 · fixed in 5100dd4The paragraph on numbers comes after the LB1811 figure. F7 · notedThe GUI keeps its closures for now. It can switch to numbers separately. Verified
|
|
Agent review, round 2: approve · 0 blocker, 0 should, 0 nit · merges cleanly, CI passes on Julia 1 and 1.12, docs build passes Full review for agents (7 earlier findings resolved, 1 new note)Scope
Verified
FindingsF1 · resolvedAll nine hrefs use the F2 · resolved
F3 · resolved
F4 · resolvedBoth F5 · resolved
F6 · resolvedThe paragraph follows the figure. F7 · resolvedNote from round 1, no change was requested. F8 · note ·
|
Refractive indices are subtypes of AbstractRefractiveIndex, whose docstring is the contract n(λ) -> Real; ConstantRefractiveIndex, DiscreteRefractiveIndex and SellmeierEquation subtype it. Constructors take n::AbstractRefractiveIndex: numbers and functions throw a MethodError, a constant index is ConstantRefractiveIndex(c). The RefractiveIndex union, the number methods of Lens/Prism and test_refractive_index_function are removed; a testset checks the contract for every subtype in the package. Breaking: λ -> 1.5 and 1.5 as n no longer work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Agent review, round 3: changes requested · 1 blocker, 2 should, 2 nit · merges cleanly, 4531 tests pass, Documentation CI fails
Full review for agents (F8 still open, 6 new findings)Scope
Verified
FindingsF8 · still open ·
|
- Asphere example and its printed copy use ConstantRefractiveIndex (F9) - Prose and the properties docstring describe constant indices (F11) - Comment on the conversion of the index type (F12) - TestBeamsplitters.jl back to LF line endings (F13) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Agent response to review round 3 · 5 fixed, 2 noted · tests pass, local docs build passes Full response for agentsScopeThe redesign in e434f0e is a decision of the maintainer, taken after round 2: indices are subtypes of FindingsF8 · notedNot caused by this PR, as on master. F9 · fixed in 0a0f9b9
F10 · fixed in the PR descriptionThe description states the dependency: GUI #56 has to be merged directly after this PR, since GUI main tracks this repository's master. With #56 checked out, the full GUI suite passes against e434f0e, Aqua included; a temporary environment loaded this branch from a local path. F11 · fixed in 0a0f9b9
F12 · fixed in 0a0f9b9The comment says that a model F13 · fixed in 0a0f9b9
F14 · notedAccepted, as the review says. Verified
|
* Test: coincident-boundary matrix for cemented lenses, beamsplitters and touching bodies (#167) * Test: constant refractive indices as ConstantRefractiveIndex after #213 * Test: coincident boundaries read internals through one adapter, near-contact cases - All access to BMO internals of TestCoincidentBoundaries.jl in one adapter block; the tests use exported names, AbstractTrees.children and the coating getter, no component or beamlet fields - Beamlet split checked through the physical on-axis field for both models, with the documented Fresnel loss of the astigmatic beamlet at the uncoated back face of the plate - Separate touching plates with gaps and overlaps far below and far above the coincidence tolerance, and rotated and moved together - Benchmark adds the 50 lenses off the beam path (same code as #177) - Leftover lines removed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test: thin splitter between plates checked ray by ray, no representation checks - The branches of the thin beamsplitter between touching plates are compared with the reference trace in position, direction and index of every ray (ray_error, shared with path_error) - Equal-glass doublet and triplet compared with the singlet by the sequence of media, not by the number of rays; the owner of a hit on coincident faces is no longer fixed - Benchmark name column wide enough for the crowded rows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test: touching objects are one interface, stated as the target of the matrix Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test: touching plates carry the Fresnel loss of one glass-glass interface - Polarized ray through touching plates at normal incidence: the flux n |E|² behind them is the Fresnel chain with one glass-glass step, none for equal glass; with a 1 µm gap two glass-air faces. @test_broken on master, passing with #178 - Fresnel transmission at normal incidence and the flux of a polarized ray as shared helpers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: uitt_hu <hugo.uittenbosch@dlr.de> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Test: coincident-boundary matrix for cemented lenses, beamsplitters and touching bodies (#167) * Feature: coincident hits of touching surfaces, the hint only speeds up the trace (#167) trace_all and trace_one collect all surfaces that a ray hits within get_coincidence_tolerance() (1 nm) of the closest hit as a chain of coincident hits. Objects whose bounding sphere lies beyond the closest hit are not tested. The hinted object is tested first, but its hit no longer wins over a closer one: among coincident hits, the hinted shape comes first. Parts of doublets and cube beamsplitters that are moved apart now show the air gap. * Bugfix: coincident hits without a shape are kept (#177) The shape of an Intersection is optional. Hits of objects with an own intersect3d that leave it empty were taken for duplicates of each other, such that only one of them stayed in the chain of coincident hits. Hits without a shape are now always kept; duplicates no longer arise, since the hinted object is not tested twice. * Internal: hit chains with one default tolerance, first_of shared by the hint order * Docs: core diagrams show coincident hits, the beyond-skip and the hint as an optimization * Style: argument names and label comments (AGENTS.md N1, C1) * Style: argument name in first_of_shape (N1) * Test: constant refractive indices as ConstantRefractiveIndex after #213 * Test: constant refractive indices as ConstantRefractiveIndex after #213 * Test: coincident boundaries read internals through one adapter, near-contact cases - All access to BMO internals of TestCoincidentBoundaries.jl in one adapter block; the tests use exported names, AbstractTrees.children and the coating getter, no component or beamlet fields - Beamlet split checked through the physical on-axis field for both models, with the documented Fresnel loss of the astigmatic beamlet at the uncoated back face of the plate - Separate touching plates with gaps and overlaps far below and far above the coincidence tolerance, and rotated and moved together - Benchmark adds the 50 lenses off the beam path (same code as #177) - Leftover lines removed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test: thin splitter between plates checked ray by ray, no representation checks - The branches of the thin beamsplitter between touching plates are compared with the reference trace in position, direction and index of every ray (ray_error, shared with path_error) - Equal-glass doublet and triplet compared with the singlet by the sequence of media, not by the number of rays; the owner of a hit on coincident faces is no longer fixed - Benchmark name column wide enough for the crowded rows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test: touching objects are one interface, stated as the target of the matrix Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test: touching plates carry the Fresnel loss of one glass-glass interface - Polarized ray through touching plates at normal incidence: the flux n |E|² behind them is the Fresnel chain with one glass-glass step, none for equal glass; with a 1 µm gap two glass-air faces. @test_broken on master, passing with #178 - Fresnel transmission at normal incidence and the flux of a polarized ray as shared helpers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Bugfix: hinted objects in groups tested once, skip applies within groups (#177 review) - closest_hits descends into object groups, so the hinted object is skipped there too and the members beyond the closest hit are not tested - Contract: the bounding sphere of an object encloses every hit of its intersect3d, also of a method of its own; an object whose hits leave its shape returns NoBoundingSphere() (AbstractObject, bounding_sphere_of, AGENTS.md extension promise); tests for both object orders - Hint and tracing_step! docstrings: the hint only orders the tests - get_coincidence_tolerance: relation to the SDF surface threshold - Style: isbeyond, is_in_chain (N1); typed skip and target (D1) - Core diagram of trace_all shows closest_hits, skip and groups Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Bugfix: trace_all inferred again, skipped object boxed once, sphere tested once (#177 review r2) - Type assertion on the recursive closest_hits call; @nospecialize skip, since an immutable hinted object was boxed again for every part - Sphere pretest in the loop only once a hit is found; a group tests its sphere without a hit, an object leaves it to intersect3d - Comments on groups describe the current path; core.md diagram updated - Test: trace_all and trace_one inferred for System, grouped System and StaticSystem; allocations do not grow with the number of parts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Internal: group sphere test of closest_hits split into two statements, signatures reformatted Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Docs: core.md diagrams of the solver as plain yes/no flows, trace_all split into search and object hit, order of coincident hits stated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Feature: a system is an AbstractTrees tree, children(system) (#235) * Internal: AbstractTrees.children(system) replaces _top_level (#234) A System returns its objects and groups as built, other systems objects(system). A System and an ObjectGroup print as one tree into the given IO. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Bugfix: render! of a system reads children(system), not the objects field (review r1 F1) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: uitt_hu <hugo.uittenbosch@dlr.de> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: uitt_hu <hugo.uittenbosch@dlr.de> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: StackEnjoyer <93778924+StackEnjoyer@users.noreply.github.com>
Features
nmust be anAbstractRefractiveIndex; numbers and functions throw aMethodErrorConstantRefractiveIndex: exported index without dispersion, replacesλ -> 1.5BeamletOptics.AbstractRefractiveIndex: public contractn(λ) -> Realfor own dispersion modelsDoc changes
ConstantRefractiveIndex; catalog links follow the new signaturesSKILL.md,CHECKLIST.md,API.md,components/{materials,lenses,beamsplitters,prisms-and-dummies}.md, templates 02, 03, 07Internal changes
test_refractive_index_functionCloses #184